<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        console.log(Math.abs(2)); // 2
        console.log(Math.abs(-2)); // 2

        // 先做隐式类型转换，将 '-2'转换为数字类型 -2，然后再调用 Math.abs()
        console.log(Math.abs('-2'));

        console.log(Math.abs('hello')); // NaN
    </script>
</body>

</html>